from time import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By

d=webdriver.Edge()
d.get('https://ww.baidu.com')
sleep(3)

aelements=d.find_elements(By.CLASS_NAME,value="mnav.c-font-normal.c-color-t")
for a in aelements:
    a.click()
    sleep(1)

list1=d.window_handles
for i in list1:
    print(i)

c=d.current_window_handle
print(c)
print(d.title)

d.switch_to.window(list1[2])
e=d.current_window_handle
print(e)
print(d.title)
sleep(20)
